﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Jxym.Common.MyFile;

namespace Jxym.wlkc2011.Module.Default.server.Files
{
    public partial class fileUp : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string jsonStr = "";
                UpLoad upload = new UpLoad();
                upload.AllowExts = "jpg|txt";
                upload.Save();

                string[] filenames = upload.FileNames.Split('|');
                string[] fileexts = upload.GetExts.Split('|');
                string[] filesizes = upload.FileSizes.Split('|');

                for (int i = 0; i < filenames.Length; i++)
                {
                    string filename = filenames[i];
                    string fileext = fileexts[i];
                    string filesize = filesizes[i];
                }

                string Err = upload.ErrorStr;
                if (Err != "")
                    jsonStr = "{'success':false,'msg':'" + Err + "'}";
                else
                    jsonStr = "{'success':true,'count':'" + filenames.Length + "'}";
                Response.Write(jsonStr);
            }
        }
    }
}